-
Notifications
You must be signed in to change notification settings - Fork 29.6k
[docs] update other params type of metadata image routes #84491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx
Show resolved
Hide resolved
docs/01-app/03-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx
Outdated
Show resolved
Hide resolved
| `app/shop/[tag]/[item]/opengraph-image.js` | `/shop/1/2` | `{ tag: '1', item: '2' }` | | ||
| Route | URL | `params` | | ||
| ------------------------------------------ | ----------- | ---------------------------------- | | ||
| `app/shop/opengraph-image.js` | `/shop` | `Promise<undefined>` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huozhi I guess this one is technically correct though? or will the entire params object be undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yea this shouldn't change
| Route | URL | `params` | | ||
| ------------------------------- | ----------- | ---------------------------------- | | ||
| `app/shop/icon.js` | `/shop` | `Promise<undefined>` | | ||
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' >}` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a syntax error in the Promise type declaration. The closing bracket is misplaced - it should be Promise<{ slug: '1' }>
rather than Promise<{ slug: '1' >}
.
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' >}` | | |
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' }>` | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
In v6, the
params
argument of metadata image routes will become params, which is aligned with other page routes in App Router.The 2nd argument
id
will becomePromise<string>
if you usegenerateImageMetadata